package cn.iocoder.yudao.module.api.trade.verify.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  这里是文件说明
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/03/18
 */
@Getter
@RequiredArgsConstructor
public enum VerifyBizType implements EnumValuable {
    UNKNOWN(0, "未知"),
    TRADE_ORDER(1, "交易单"),
    GIFT_RECORD(2, "赠品"),
    COUPON_RECORD(3, "优惠券"),
    ;

    @EnumValue
    private final Integer value;
    private final String name;

    public static VerifyBizType valueOf(int value) {
        return Arrays.stream(values())
                .filter(method -> method.value == value)
                .findFirst()
                .orElse(UNKNOWN);
    }

}
